<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>招生监督工作情况列表页面</title>
<%@ include file="/module/js.jsp"%>
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>
</head>
<body>
	<form action="#" name="Form" id="Form" method="post">
		<input type="hidden" name="idList" id="idList" />
		<%@ include file="/module/orderField.jsp"%>
		<table cellpadding="1" cellspacing="1" border="0">
			<tr>
				<td><input type="button" id="btnExport" value="导出"
					class="inputButton" /></td>
					
					<td><input type="button" id=btnPrint” value="打印"
					class="inputButton" /></td>
					
					<td><input type="button" id="btnBackList" value="返回列表"
					class="inputButton" /></td>
					
					
			</tr>
		</table>
		
		<br />
		<table id="dg" style="width: 100%;"
			data-options="pagination:true,collapsible:true,url:'${basePath}/partyEnrollSupervise/list2',method:'post',remoteSort:true">
			<thead>
				<tr>
					<th
						data-options="field:'rownumber',rownumbers:true,width:80,align:'center'">序号</th>
					<th
						data-options="field:'jDNFYear',nowrap:true,width:200,align:'center',sortable:true">年份</th>
					<th
						data-options="field:'attList',nowrap:true,width:200,align:'center',sortable:true
						,formatter: planUrl"></th>
					 
				</tr>
			</thead>
		</table>
	</form>
	<script type="text/javascript">
		$(document)
				.ready(
						function() {

							$('#dg')
									.datagrid(
											{
												rowStyler : function(index, row) {
												},
												onLoadSuccess : function(data) {//加载完毕后获取所有的checkbox遍历
													if (data.rows.length > 0) {
													}
												},
											});
							//查询
							$('#btnQuery').click(function() {
								$('#dg').datagrid('load', {
									jDNF:$("#jDNF").val()
								});
							});
							
							
							$('#easyui-ck').click(function() {
								var data = $("#dg").datagrid("getSelections");
								for (var i = 0; i < data.length; i++) {
								}
							});
							
							//打印
							$('#btnPrint”')
							.click(
									function() {
										document.execCommand("print");
									}
								);
							//返回列表
							$('#btnBackList')
							.click(
									function() {
										window.location.href = "${basePath}/partyEnrollSupervise/index";
									});
							
							$('#btnExport')
							.on(
									'click',
									function() {
										layer
												.confirm(
														"您确定要导出吗?",
														{
															icon : 3,
															title : '提示',
															skin : 'layer-ext-moon'
														},
														function(index) {
															layer
																	.closeAll('dialog');//解决导出成功后提示框不关闭的问题
															document.Form.action = "${basePath}/partyEnrollSupervise/exportpartyEnrollSupervise2";
															document.Form
																	.submit();
														});
									});
							
							$('#btnDelete')
									.click(
											function() {
												$("#idList").val("");
												var count = 0;
												var idList = new Array();
												var sels = $("#dg").datagrid(
														"getSelections");
												for ( var i in sels) {
													idList.push(sels[i].jdid);
													count++;
												}

												if (count == 0) {
													layer.alert(
															"您至少选择一条删除记录信息", {
																icon : 3
															});
													return false;
												} else {
													layer
															.confirm(
																	"您是否删除当前选中数据信息",
																	{
																		icon : 3,
																		title : '提示',
																		skin : 'layer-ext-moon'
																	},
																	function(
																			index) {
																		$(
																				"#idList")
																				.val(
																						idList);
																		document.Form.action = "${basePath}/partyEnrollSupervise/delete";
																		document.Form
																				.submit();
																	},
																	function(
																			index) {
																		layer
																				.close(index);
																	});
												}
											});
						});
		if ("${msg}" != "") {
			layer.alert("${msg}", {
				icon : 6
			});
		}
		
		
		function planUrl(value,row,index){
	        var roles = '';
	        if(row.attList != null){
	        	  for(var i=0;i<row.attList.length;i++){
	 	             roles += "<a href=${basePath}/DownLoadFileServlet?filename="+row.attList[i].fileName +"&filepath="+row.attList[i].filePath+">"+row.attList[i].fileName+"</a><br/>";
	 	        }
	        }
	      
	        return roles;
		}

	 
	</script>
</body>
</html>
